package com.torchclx.adapterdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    @GetMapping("/get")
    public String get() {
        return redisTemplate.opsForValue().get("animal");
    }


    @GetMapping("/set")
    public void set() {
        redisTemplate.opsForValue().set("name11","clx11");
    }
}
